/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.calculator;

/**
 *
 * @author JSJSYS
 */
public class yunsuan {
     private double value;
    
    
    public void delete(){
        value = 0;
    }
    
    public void add(double number){
        value += number;
    }
    
    public void minus(double number){
        if((value==0)) {
            value=number;
         } else {
            value -= number;
         }
    }
    public void divide(double number){
    
       if(value==0)
       {value=number;
       }
       else{
           value=value/number;
       }
       
        
    }
    
    public void multiply(double number){
        if(value==0){
            value=number;
        }
        else{
        value *= number;
        }
    }
    public void value(double number){
        value+=number;
    
    }
    public double getValue() {
        return value;
    }
}
